package cc.sjfx.sharedoc.db.bmob;

import java.util.ArrayList;
import java.util.List;

import android.annotation.SuppressLint;
import android.content.Context;
import cc.sjfx.sharedoc.cache.UserCache;
import cn.bmob.v3.BmobUser;

@SuppressLint("UseValueOf")
@SuppressWarnings("serial")
public class User extends BmobUser {
	private String nickName;
	private String ico;
	private String icoName;
	private Integer publishNum;
	private Integer answerNum;
	private Integer collectNum;
	private Integer sex;
	private String sign;
	private String school;
	private String major;
	private Integer sid;
	private Integer mid;
	private String sessionId;
	private Integer cid;
	private List<String> collectList;
	private List<Integer> eidList;
	public int getCid() {
		if(cid!=null)
		return cid.intValue();
		return 0;
	}
	public void setCid(int cid) {
		this.cid = new Integer(cid);
	}
	public String getMajor_class() {
		return major_class;
	}
	public void setMajor_class(String major_class) {
		this.major_class = major_class;
	}

	private String major_class;
	public String getSessionId() {
		return sessionId;
	}
	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}
	public String getSchool() {
		return school;
	}
	public void setSchool(String school) {
		this.school = school;
	}
	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}
	public int getMid() {
		if (mid != null)
			return mid.intValue();
		return 0;
	}

	public void setMid(int mid) {
		this.mid = new Integer(mid);
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getNickName() {
		return nickName;
	}

	public void setIco(String ico) {
		this.ico = ico;
	}

	public String getIco() {
		return ico;
	}

	public void setIcoName(String icoName) {
		this.icoName = icoName;
	}

	public String getIcoName() {
		return icoName;
	}

	public void setPublishNum(int publishNum) {
		this.publishNum = new Integer(publishNum);
	}

	public int getPublishNum() {
		if (publishNum != null) {
			return publishNum.intValue();
		}
		return 0;
	}

	public void setAnswerNum(int answerNum) {
		this.answerNum = new Integer(answerNum);
	}

	public int getAnswerNum() {
		if (answerNum != null) {
			return answerNum.intValue();
		}
		return 0;
	}

//	public void setCollectNum(int collectNum) {
//		this.collectNum = new Integer(collectNum);
//	}

	public int getCollectNum() {
		if (collectNum != null) {
			return collectNum.intValue();
		}
		return 0;
	}

	public void setSex(int sex) {
		this.sex = new Integer(sex);
	}

	public int getSex() {
		if (sex != null) {
			return sex.intValue();
		}
		return 0;
	}

	public void setSid(int sid) {
		this.sid = new Integer(sid);
	}

	public int getSid() {
		return sid.intValue();
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getSign() {
		return sign;
	}
	public List<String> getCollectList() {
		if(collectList==null){
			return new ArrayList<String>();
		}
		return collectList;
	}
	public void setCollectList(List<String> collectList) {
		this.collectList = collectList;
		collectNum=collectList.size();
	}
	public static void logOut(Context context) {
		BmobUser.logOut(context);
		UserCache.user=null;
		UserCache.isLogin = false;
	}
	public List<Integer> getEidList() {
		if(eidList==null){
			return new ArrayList<Integer>() ;
		}
		return eidList;
	}
	public void setEidList(List<Integer> eidList) {
		this.eidList = eidList;
	}
	
}
